﻿using ServerControl.Model.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ServerControl.Model
{
    public class ResponseResult
    {
        public ResultCode Code { get; set; }
        public string Msg { get; set; }
    }

    public class SuccessResult : ResponseResult
    {
        public ResultCode Code { get => ResultCode.Success; }
    }

    public class FailResult : ResponseResult
    {
        public ResultCode Code { get => ResultCode.Fail; }
    }

    public class ResponseResult<T> : ResponseResult
    {
        public T Data { get; set; }
        public int Count { get; set; }
    }

    public class SuccessResult<T> : ResponseResult<T>
    {
        public ResultCode Code { get => ResultCode.Success; }
        /// <summary>
        /// 合计行
        /// </summary>
        public object TotalRow { get; set; }
    }

    public class FailResult<T> : ResponseResult<T>
    {
        public ResultCode Code { get => ResultCode.Fail; }
    }
}
